package com.basic

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SparkSession

object DS2RDD {
  def main(args: Array[String]): Unit = {
    val spark: SparkSession = SparkSession
      .builder()
      .master("local[*]")
      .appName("DS2RDD")
      .getOrCreate()
    import spark.implicits._

    val ds = Seq(User("lisi", 40), User("zs", 20)).toDS
    val rdd: RDD[User] = ds.rdd
    rdd.collect.foreach(println)
    spark.stop()
  }
}
